import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FeeValueVO, FeeValueForm, FeeValueQuery } from '@/api/apartment/attribute/feeValue/types';

/**
 * 查询杂项费用值列表
 * @param query
 * @returns {*}
 */

export const listFeeValue = (query?: FeeValueQuery): AxiosPromise<FeeValueVO[]> => {
  return request({
    url: '/apartment/feeValue/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询杂项费用值详细
 * @param id
 */
export const getFeeValue = (id: string | number): AxiosPromise<FeeValueVO> => {
  return request({
    url: '/apartment/feeValue/' + id,
    method: 'get'
  });
};

/**
 * 新增杂项费用值
 * @param data
 */
export const addFeeValue = (data: FeeValueForm) => {
  return request({
    url: '/apartment/feeValue',
    method: 'post',
    data: data
  });
};

/**
 * 修改杂项费用值
 * @param data
 */
export const updateFeeValue = (data: FeeValueForm) => {
  return request({
    url: '/apartment/feeValue',
    method: 'put',
    data: data
  });
};

/**
 * 删除杂项费用值
 * @param id
 */
export const delFeeValue = (id: string | number | Array<string | number>) => {
  return request({
    url: '/apartment/feeValue/' + id,
    method: 'delete'
  });
};
